﻿using System.Configuration;
using Framework;

namespace Enterprise
{
    public class ConfigService
    {
        static ConfigService()
        {
            ThumbnailWidth = ConfigurationManager.AppSettings["ThumbnailWidth"].SafeToInt();
            ThumbnailHeight = ConfigurationManager.AppSettings["ThumbnailHeight"].SafeToInt();
            ThumbnailPrefix = ConfigurationManager.AppSettings["ThumbnailPrefix"].SafeToString();
            NormalWidth = ConfigurationManager.AppSettings["NormalWidth"].SafeToInt();
            NormalHeight = ConfigurationManager.AppSettings["NormalHeight"].SafeToInt();
            NormalPrefix = ConfigurationManager.AppSettings["NormalPrefix"].SafeToString();
            ImageSize = ConfigurationManager.AppSettings["ImageSize"].SafeToInt();
            IsWaterMark = ConfigurationManager.AppSettings["IsWaterMark"].SafeToBool();
            IsGenerateThumbnail = ConfigurationManager.AppSettings["IsGenerateThumbnail"].SafeToBool();
            IsGenerateNormal = ConfigurationManager.AppSettings["IsGenerateNormal"].SafeToBool();
            IsAdaptive = ConfigurationManager.AppSettings["IsImageAdaptive"].SafeToBool();
            WaterMarkFileName = ConfigurationManager.AppSettings["WaterMarkFileName"].SafeToString();
            WaterMarkRelativePath = ConfigurationManager.AppSettings["WaterMarkRelativePath"].SafeToString();
            RelativePath = ConfigurationManager.AppSettings["ImageRelativePath"].SafeToString();

            ConStringEncrypt = ConfigurationManager.AppSettings["ConStringEncrypt"].SafeToBool();
            EncryptionKey = ConfigurationManager.AppSettings["EncryptionKey"].SafeToString();
            ConnStringEncryptionKey = ConfigurationManager.AppSettings["ConnStringEncryptionKey"].SafeToString();
            SqlProfileConnString = ConfigurationManager.AppSettings["SQLProfileConnString"].SafeToString();
            ConnectionString = ConfigurationManager.AppSettings["ConnectionString"].SafeToString();
            ImageType = ConfigurationManager.AppSettings["ImageType"].SafeToString();
            FileType = ConfigurationManager.AppSettings["FileType"].SafeToString();
            FileSize = ConfigurationManager.AppSettings["FileSize"].SafeToInt();
            Language = ConfigurationManager.AppSettings["Language"].SafeToString();

            StaticPagePath = ConfigurationManager.AppSettings["StaticPagePath"].SafeToString();
            StaticPageTemplatePath = ConfigurationManager.AppSettings["StaticPageTemplatePath"].SafeToString();

            StaticPageSuffix = ConfigurationManager.AppSettings["StaticPageSuffix"].SafeToString();
            StaticPageMasterFileName = ConfigurationManager.AppSettings["StaticPageMasterFileName"].SafeToString();
            StaticPageTemplateSuffix = ConfigurationManager.AppSettings["StaticPageTemplateSuffix"].SafeToString();
            Depth = ConfigurationManager.AppSettings["Depth"].SafeToInt();
        }
        /// <summary>
        /// 获取连接字符串
        /// </summary>
        public static int ThumbnailWidth { get; set; }

        public static int ThumbnailHeight { get; set; }

        public static string ThumbnailPrefix { get; set; }

        public static int NormalWidth { get; set; }

        public static int NormalHeight { get; set; }

        public static string NormalPrefix { get; set; }

        public static int ImageSize { get; set; }

        public static bool ConStringEncrypt { get; set; }

        public static string EncryptionKey { get; set; }

        public static string ConnStringEncryptionKey { get; set; }

        public static string SqlProfileConnString { get; set; }

        public static string ConnectionString { get; set; }

        public static string ImageType { get; set; }

        public static string FileType { get; set; }

        public static int FileSize { get; set; }

        public static string Language { get; set; }

        public static bool IsGenerateThumbnail { get; set; }

        public static bool IsWaterMark { get; set; }

        public static string RelativePath { get; set; }

        public static string WaterMarkFileName { get; set; }

        public static string WaterMarkRelativePath { get; set; }

        public static bool IsGenerateNormal { get; set; }

        public static bool IsAdaptive { get; set; }

        public static string StaticPageTemplatePath { get; set; }

        public static string StaticPagePath { get; set; }

        public static string StaticPageSuffix { get; set; }

        public static string StaticPageMasterFileName { get; set; }
        public static string StaticPageTemplateSuffix { get; set; }
        /// <summary>
        /// 启用会员激活
        /// </summary>
        public static bool IsMemberActivation { get; set; }

        public static string SmtpServer { get; set; }

        public static string EmailAccount { get; set; }

        public static string EmailPassword { get; set; }

        public static string From { get; set; }


        public static int Depth { get; set; }

    }

}